package com.mz.ieann.aide.pager.view

import android.content.Intent
import android.view.View
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.mz.ieann.aide.R
import com.mz.ieann.aide.base.vm.BaseVMActivity
import com.mz.ieann.aide.databinding.ActivityWeicomeLayoutBinding
import com.mz.ieann.aide.main.MainActivity
import com.mz.ieann.aide.pager.adapter.WelComePagerAdapter
import com.mz.ieann.aide.pager.model.WelComeViewModel

/**
 * <p>------------------------------------------------------
 * <p> Copyright (C) 2021 zhangmz, All rights reserved.
 * <p>------------------------------------------------------
 * <p> des
 * <p>
 *
 * @author Created by Administrator
 * @date on 2021 2021/9/11 10:40
 */
class WelComeActivity : BaseVMActivity<WelComeViewModel, ActivityWeicomeLayoutBinding>(R.layout.activity_weicome_layout) {

    override fun initActivity() {
        val controller = ViewCompat.getWindowInsetsController(binding.root)
        controller?.hide(WindowInsetsCompat.Type.statusBars())

        viewModel.queryWelcomeImg()
        viewModel.imgList.observe(this) {
            binding.viewPager.adapter = WelComePagerAdapter(it)
        }
    }

    fun intoMain(view : View){
        startActivity(Intent(this, MainActivity::class.java))
        finish()
    }


}